// C:\Windows\System32\drivers\etc\hosts
// 127.0.0.1 zhangpeiyue.com
const express = require('express');
const axios = require("axios");
const app = express();
app.use((req,res,next)=>{
    res.set("Access-Control-Allow-Origin", "*");// 增加响应头，允许访问资源
    console.log(1);
    next();
})
app.use(express.static(__dirname));// 将当前目录设置为静态资源
// 请求方式为get
// 请求地址为/maoyan
app.get("/maoyan",(req,res)=>{
    // axios
    axios.get("https://i.maoyan.com/api/mmdb/movie/v3/list/hot.json?ct=鞍山&ci=151&channelId=4").then(value=>{
        res.json(value.data);
    })
})
app.listen(80,()=>{
    // http 80
    // https 443
    console.log("success")
})